package com.fqgj.xjd.user.dao.impl;
import com.fqgj.common.base.AbstractBaseMapper;
import com.fqgj.xjd.user.dao.UserCategoryDao;
import com.fqgj.xjd.user.entity.UserCategoryEntity;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* User: sm
* Date: 2019-09-02
* Time: 17:00:46.537
*/

@Repository
public class UserCategoryDaoImpl extends AbstractBaseMapper<UserCategoryEntity> implements UserCategoryDao {

    @Override
    public List<UserCategoryEntity> selectListByUserCodes(List<String> userCodes) {
        Map<String, Object> params = new HashMap();
        params.put("userCodes", userCodes);
        return getSqlSession().selectList(getStatement("selectListByUserCodes"), params);
    }

    @Override
    public List<UserCategoryEntity> selectListByUserCodeAndCategoryCode(String userCode, String categoryCode) {
        Map<String, Object> params = new HashMap();
        params.put("userCode", userCode);
        params.put("categoryCode", categoryCode);
        return getSqlSession().selectList(getStatement("selectListByUserCodeAndCategoryCode"), params);
    }

    @Override
    public List<UserCategoryEntity> selectListByUserCode(String userCode) {
        Map<String, Object> params = new HashMap();
        params.put("userCode", userCode);
        return getSqlSession().selectList(getStatement("selectListByUserCode"), params);
    }
}